var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(c, b, a) {
    if (cm.isQuestActive(37413) && cm.getNumberFromQuestInfo(37413, "dir") == 0) {
        action2(c, b, a)
    } else {
        action1(c, b, a)
    }
}

function action1(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            cm.npc_ChangeController(3004403, "oid=368256", -285, 35, 16, -335, -235, 1, false, 0, false);
            cm.npc_ChangeController(3004404, "oid=368257", -732, 35, 23, -782, -682, 1, false, 0, false);
            cm.npc_ChangeController(3004407, "oid=368258", 635, 35, 7, 585, 685, 1, false, 0, false);
            cm.npc_ChangeController(3004300, "oid=368259", -1046, 35, 25, -1096, -996, 1, false, 0, false);
            cm.npc_ChangeController(3004419, "oid=368260", 794, 35, 6, 744, 844, 1, false, 0, false);
            cm.npc_ChangeController(3004421, "oid=368261", -876, 35, 22, -926, -826, 0, false, 0, false);
            cm.npc_ChangeController(3004416, "oid=368262", 274, 35, 11, 224, 324, 1, false, 0, false);
            cm.npc_ChangeController(3004420, "oid=368263", -386, 35, 18, -436, -336, 0, false, 0, false);
            cm.npc_ChangeController(3004422, "oid=368264", 163, 35, 12, 113, 213, 1, false, 0, false);
            cm.npc_ChangeController(3004423, "oid=368265", 24, -62, 0, -26, 74, 1, false, 0, false);
            cm.npc_ChangeController(3004423, "oid=368266", -165, -63, 0, -215, -115, 0, false, 0, false);
            cm.npc_ChangeController(3004449, "oid=368267", 768, -68, 0, 718, 818, 1, false, 0, false);
            cm.npc_ChangeController(3004449, "oid=368268", 860, -50, 0, 810, 910, 1, false, 0, false);
            cm.npc_ChangeController(3004448, "oid=368269", -874, -67, 0, -924, -824, 0, false, 0, false);
            cm.npc_ChangeController(3004448, "oid=368270", -945, -35, 0, -995, -895, 0, false, 0, false);
            cm.npc_ChangeController(3004425, "oid=368271", 458, -77, 0, 408, 508, 1, false, 0, false);
            cm.npc_ChangeController(3004451, "oid=368272", -635, -69, 0, -685, -585, 0, false, 0, false);
            cm.npc_ChangeController(3004452, "oid=368273", -573, -69, 0, -623, -523, 0, false, 0, false);
            if (cm.isQuestActive(37414)) {
                cm.setPartner(1, 3004430, 80002825, 0)
            }
            if (cm.getNumberFromQuestInfo(37403, "dir") > 0) {
                cm.dispose();
                return
            }
            cm.curNodeEventEnd(true);
            cm.eventSKill(0);
            cm.setInGameDirectionMode(true, false, true);
            cm.inGameDirectionEvent_SetAdditionalEffectVisibleForInGameDirection2();
            cm.fieldEffect_InsertCanvas(1, 255, 0, 0, 0, 0, 0);
            cm.setStandAloneMode(true);
            cm.npc_ChangeController(3004431, "oid=511840", -470, -26, 19, -520, -420, 1, true, 0, false);
            cm.npc_SetSpecialAction("oid=511840", "summon", 0, 0);
            cm.inGameDirectionEvent_PushScaleInfo(0, 0, 2000, 0, -485, 30);
            cm.curNodeEventEnd(true)
        } else {
            if (status === a++) {
                cm.fieldEffect_InsertCanvas(1, 255, 0, 0, 0, 0, 0);
                cm.inGameDirectionEvent_AskAnswerTime(1200)
            } else {
                if (status === a++) {
                    cm.fieldEffect_InsertCanvas(0, 0, 0, 0, 0, 1000, 0);
                    cm.inGameDirectionEvent_AskAnswerTime(1400)
                } else {
                    if (status === a++) {
                        cm.sendNormalTalk_Bottom("其他人呢？", 57, 0, false, true)
                    } else {
                        if (status === a++) {
                            cm.sendNormalTalk_Bottom("#face0#打着收集情报的旗号，光明正大地四处游玩。", 37, 3004431, true, true);
                            cm.effect_Voice("Voice5.img/CH2/Idea/20", 128)
                        } else {
                            if (status === a++) {
                                cm.sendNormalTalk_Bottom("#face0#今天是自由行动，#h0#大人也在城里四处看一看吧。\r\n不过，期间还请留意一下城市里都有哪些势力，以及相互之间的关系如何。", 37, 3004431, true, true);
                                cm.effect_Voice("Voice5.img/CH2/Idea/21", 128)
                            } else {
                                if (status === a++) {
                                    cm.sendNormalTalk_Bottom("#face0#还有，如果遇到需要帮助的人，要积极地向他们伸出援手。\r\n这样才好树立我们联盟的正面形象。", 37, 3004431, true, true);
                                    cm.effect_Voice("Voice5.img/CH2/Idea/22", 128)
                                } else {
                                    if (status === a++) {
                                        cm.sendNormalTalk_Bottom("#face0#请不要忘记。我们的目标是守卫#b圣地塞尔提乌#k，以及……", 37, 3004431, true, true);
                                        cm.effect_Voice("Voice5.img/CH2/Idea/23", 128)
                                    } else {
                                        if (status === a++) {
                                            cm.sendNormalTalk_Bottom("确认古代神的力量。", 57, 0, true, true)
                                        } else {
                                            if (status === a++) {
                                                cm.sendNormalTalk_Bottom("#face0#没错。那么我们之后见面时再交换情报。", 37, 3004431, true, true);
                                                cm.effect_Voice("Voice5.img/CH2/Idea/24", 128)
                                            } else {
                                                if (status === a++) {
                                                    cm.updateInfoQuest(37403, "dir=1");
                                                    cm.OverlapScreenDetail19(0, 1000, 3000, 1);
                                                    cm.inGameDirectionEvent_PushScaleInfo(0, 0, 1000, 2147483647, 2147483647, 2147483647)
                                                } else {
                                                    if (status === a++) {
                                                        cm.inGameDirectionEvent_PushMoveInfo(1, 0, 0, 0)
                                                    } else {
                                                        if (status === a++) {
                                                            cm.inGameDirectionEvent_AskAnswerTime(300)
                                                        } else {
                                                            if (status === a++) {
                                                                cm.fieldEffect_RemoveOverlapScreenDetail(1000);
                                                                cm.eventSKill(0);
                                                                cm.setInGameDirectionMode(false, true, false);
                                                                cm.setStandAloneMode(false);
                                                                cm.dispose()
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

function action2(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            cm.npc_ChangeController(3004403, "oid=368256", -285, 35, 16, -335, -235, 1, false, 0, false);
            cm.npc_ChangeController(3004404, "oid=368257", -732, 35, 23, -782, -682, 1, false, 0, false);
            cm.npc_ChangeController(3004407, "oid=368258", 635, 35, 7, 585, 685, 1, false, 0, false);
            cm.npc_ChangeController(3004300, "oid=368259", -1046, 35, 25, -1096, -996, 1, false, 0, false);
            cm.npc_ChangeController(3004419, "oid=368260", 794, 35, 6, 744, 844, 1, false, 0, false);
            cm.npc_ChangeController(3004421, "oid=368261", -876, 35, 22, -926, -826, 0, false, 0, false);
            cm.npc_ChangeController(3004416, "oid=368262", 274, 35, 11, 224, 324, 1, false, 0, false);
            cm.npc_ChangeController(3004420, "oid=368263", -386, 35, 18, -436, -336, 0, false, 0, false);
            cm.npc_ChangeController(3004422, "oid=368264", 163, 35, 12, 113, 213, 1, false, 0, false);
            cm.npc_ChangeController(3004423, "oid=368265", 24, -62, 0, -26, 74, 1, false, 0, false);
            cm.npc_ChangeController(3004423, "oid=368266", -165, -63, 0, -215, -115, 0, false, 0, false);
            cm.npc_ChangeController(3004449, "oid=368267", 768, -68, 0, 718, 818, 1, false, 0, false);
            cm.npc_ChangeController(3004449, "oid=368268", 860, -50, 0, 810, 910, 1, false, 0, false);
            cm.npc_ChangeController(3004448, "oid=368269", -874, -67, 0, -924, -824, 0, false, 0, false);
            cm.npc_ChangeController(3004448, "oid=368270", -945, -35, 0, -995, -895, 0, false, 0, false);
            cm.npc_ChangeController(3004425, "oid=368271", 458, -77, 0, 408, 508, 1, false, 0, false);
            cm.npc_ChangeController(3004451, "oid=368272", -635, -69, 0, -685, -585, 0, false, 0, false);
            cm.npc_ChangeController(3004452, "oid=368273", -573, -69, 0, -623, -523, 0, false, 0, false);
            cm.curNodeEventEnd(true);
            cm.eventSKill(0);
            cm.setInGameDirectionMode(true, false, true);
            cm.inGameDirectionEvent_SetAdditionalEffectVisibleForInGameDirection2();
            cm.fieldEffect_InsertCanvas(1, 255, 0, 0, 0, 0, 0);
            cm.setStandAloneMode(true);
            cm.onTeleport(0, 3, cm.getPlayer().getId(), -283, -14);
            cm.npc_ChangeController(3004446, "oid=558641", 260, -23, 13, 210, 310, 0, true, 0, false);
            cm.npc_SetSpecialAction("oid=558641", "summon", 0, 0);
            cm.fieldEffect_InsertCanvas(1, 255, 0, 0, 0, 0, 0);
            cm.inGameDirectionEvent_AskAnswerTime(1200);
            cm.curNodeEventEnd(true)
        } else {
            if (status === a++) {
                cm.fieldEffect_InsertCanvas(0, 0, 0, 0, 0, 1000, 0);
                cm.inGameDirectionEvent_AskAnswerTime(1400)
            } else {
                if (status === a++) {
                    cm.inGameDirectionEvent_AskAnswerTime(1000)
                } else {
                    if (status === a++) {
                        cm.sendNormalTalk_Bottom("嗯？", 57, 0, false, true)
                    } else {
                        if (status === a++) {
                            cm.OverlapScreenDetail19(0, 1000, 3000, 1);
                            cm.inGameDirectionEvent_PushScaleInfo(0, 0, 2000, 0, 300, -5)
                        } else {
                            if (status === a++) {
                                cm.inGameDirectionEvent_AskAnswerTime(300)
                            } else {
                                if (status === a++) {
                                    cm.fieldEffect_RemoveOverlapScreenDetail(1000);
                                    cm.inGameDirectionEvent_AskAnswerTime(2000)
                                } else {
                                    if (status === a++) {
                                        cm.inGameDirectionEvent_AskAnswerTime(2000);
                                        cm.effect_NormalSpeechBalloon("…….", 1, 0, 0, 1500, 1, 0, 0, 0, 4, 3004446, null, cm.getPlayer().getId())
                                    } else {
                                        if (status === a++) {
                                            cm.sendNormalTalk_Bottom("这家伙有些奇怪。", 57, 0, false, true)
                                        } else {
                                            if (status === a++) {
                                                cm.npc_SetForceMove("oid=558641", 1, 120, 100);
                                                cm.inGameDirectionEvent_AskAnswerTime(3000)
                                            } else {
                                                if (status === a++) {
                                                    cm.Npc_Fadeout("oid=558641", 0, 1000);
                                                    cm.inGameDirectionEvent_AskAnswerTime(1500)
                                                } else {
                                                    if (status === a++) {
                                                        cm.sendNormalTalk_Bottom("去哪儿了呢？我应该跟在他后面的。", 57, 0, false, true)
                                                    } else {
                                                        if (status === a++) {
                                                            cm.OverlapScreenDetail19(0, 1000, 3000, 1);
                                                            cm.inGameDirectionEvent_PushScaleInfo(0, 0, 1000, 2147483647, 2147483647, 2147483647)
                                                        } else {
                                                            if (status === a++) {
                                                                cm.inGameDirectionEvent_PushMoveInfo(1, 0, 0, 0)
                                                            } else {
                                                                if (status === a++) {
                                                                    cm.inGameDirectionEvent_AskAnswerTime(300)
                                                                } else {
                                                                    if (status === a++) {
                                                                        cm.fieldEffect_RemoveOverlapScreenDetail(1000);
                                                                        cm.eventSKill(0);
                                                                        cm.setInGameDirectionMode(false, true, false);
                                                                        cm.setStandAloneMode(false);
                                                                        cm.updateInfoQuest(37413, "dir=1");
                                                                        cm.OnStartNavigation(993140060, 0, "", 37413);
                                                                        cm.dispose()
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
};